updating oE abs

Math

Sign and Comparisons

abs

include math.e 
namespace math 
public function abs(object a) 

returns the absolute value of numbers.

Parameters:
  1. value : an object, each atom is processed, no matter how deeply nested.
Returns:

An object, the same shape as value. When value is an atom, the result is the same if not less than zero, and the opposite value otherwise.

Comments:

This function may be applied to an atom or to all elements of a sequence.

Example 1:
x = abs({10.5, -12, 3}) 
-- x is {10.5, 12, 3} 
 
i = abs(-4) 
-- i is 4 
See Also:

sign

Not Categorized, Please Help

Search



Quick Links

User menu

Not signed in.

Misc Menu